package io.xiyou.account.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.xiyou.account.dao.model.AccountInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

@Repository
public interface AccountInfoMapper extends BaseMapper<AccountInfo> {

    /**
     * 扣减金额
     *
     * @param userId
     * @param money
     * @return
     */
    int subtractAccountBalance(@Param("userId") Long userId, @Param("money") BigDecimal money);

    /**
     * 增加余额
     *
     * @param userId
     * @param money
     * @return
     */
    int addAccountBalance(@Param("userId") Long userId, @Param("money") BigDecimal money);

}